package com.example;

import org.junit.Test;

/**
 * @ClassName IntegerCompareTest
 * @Description TODO
 * @Author: XMK
 * @Date: 2021/8/9 17:12
 * @Version: 1.0
 */
public class IntegerCompareTest {

    @Test
    public void t1() {
        Integer i1 = 127;
        Integer i2 = 127;
        System.out.println(i1 == i2);
        Integer i3 = 128;
        Integer i4 = 128;
        System.out.println(i3 == i4);
        Integer i5 = new Integer(123);
        Integer i6 = new Integer(123);
        System.out.println(i5 == i6);
    }

    @Test
    public void t2() {
        String s1 = "sss";
        String s2 = "sss";
        System.out.println(s1 == s2);
        s1 = new String("sss");
        s2 = new String("sss");
        System.out.println(s1 == s2);
        System.out.println(s1.equals(s2));

        s1 = new String("abc");
        s2 = new String("abc");
        System.out.println(s1 == s2);

    }
}
